]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inputMethod: Clear preeditStr before reset
authorChristian Hergert <chergert@redhat.com>
Wed, 29 Sep 2021 19:46:45 +0000 (12:46 -0700)
committerMarge Bot <marge-bot@gnome.org>
Thu, 30 Sep 2021 17:12:02 +0000 (17:12 +0000)
Previously, these were performed in a different order before GNOME 41.
During some other changes they were swapped.

However, this causes both GTK 3 and GTK 4 applications to scroll to
incorrect positions from the preedit change.

Fixes #4647
Fixes GNOME/gtk#4289
Fixes GNOME/gnome-builder#1536
Fixes GNOME/gnome-builder#1531

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1993>

js/misc/inputMethod.js

index 25b02e35b89c909c0c31f6c6f50d18e71d63b9da..1f9eaee7a8db2a1c27f3dd078ab5888805a0396b 100644 (file)
@@ -179,16 +179,16 @@ class InputMethod extends Clutter.InputMethod {
     }
 
     vfunc_reset() {
+        if (this._context) {
+            this._context.reset();
+            this._emitRequestSurrounding();
+        }
+
         if (this._preeditStr !== null) {
             // Unset any preedit text
             this.set_preedit_text(null, 0, Clutter.PreeditResetMode.CLEAR);
             this._preeditStr = null;
         }
-
-        if (this._context) {
-            this._context.reset();
-            this._emitRequestSurrounding();
-        }
     }
 
     vfunc_set_cursor_location(rect) {